﻿@{
    Layout = null;
}
@using MvcMall.AdminPortal.Controllers.MailTemplate.ViewModels;
@using MvcContrib.UI.Grid;
@model List<MailTemplateDtoModel>
<!DOCTYPE html>
<html>
<head>
    <title>邮件通知模板管理</title>
    <link href="@Url.Content("~/Content/themes/base/jquery-ui.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery-ui.min.js")" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#tabs").tabs({
                cache: false,
                ajaxOptions: {
                    error: function (xhr, status, index, anchor) {
                        $(anchor.hash).html("系统繁忙,请稍候再试");
                    }
                }
            });
        });
    </script>
</head>
<body>
    <div id="tabs">
        <ul>
            <li><a href="#list">邮件通知模板列表</a></li>
        </ul>
        <div id="list">
            @Html.Grid(Model).Columns(m =>
            {
                m.For(c => c.MailTemplateId).Named("模板编号");
                m.For(c => c.TemplateName).Named("模板名称");
                m.For(c => c.MailTemplateType).Named("应用场景");
                m.For(c => c.Title).Named("标题");
                m.For(c => (c.MailBody.Length > 20 ? c.MailBody.Substring(0, 20) + "..." : c.MailBody)).Named("内容");
                m.For(c => Html.ActionLink("修改", "Save", "MailTemplate", new { @id = c.MailTemplateId }, null));
            }).Empty("没有查询到任何数据").Attributes(width => "100%")
        </div>
    </div>
</body>
</html>
